package com.dura.strategy.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;
import java.util.Set;

/**
 * @version 1.0
 * @Author 振鹏
 * @Date 2025/3/15 18:13
 * @注释
 */
@FeignClient(value = "beacon-cache")
public interface BeaconCacheClient {

    @GetMapping("/cache/hget/{key}/{field}")
    String hget(@PathVariable(value = "key") String key, @PathVariable(value = "field") String field);

    @GetMapping("/cache/hget/{key}/{field}")
    String hgetString(@PathVariable(value = "key") String key, @PathVariable(value = "field") String field);

    @GetMapping("/cache/get/{key}")
    String getString(@PathVariable(value = "key") String key);

    @GetMapping("/cache/smember/{key}")
    Set<String> smember(@PathVariable(value = "key") String key);

    @GetMapping("/cache/hget/{key}/{field}")
    Integer hgetInterger(@PathVariable(value = "key") String key,@PathVariable(value = "field") String field);

    @PostMapping("/cache/zadd/{key}/{score}/{member}")
    Boolean zadd(@PathVariable(value = "key")String key,@PathVariable(value = "score")Long score,@PathVariable(value = "member")Object member);

    @GetMapping("/cache/zrangebyscorecount/{key}/{start}/{end}")
    int zRangeByScoreCount(@PathVariable(value = "key") String key,@PathVariable(value = "start") Double start,@PathVariable(value = "end") Double end);

    @PostMapping("/cache/zremove/{key}/{member}")
    Boolean zRemove(@PathVariable(value = "key")String key,@PathVariable(value = "member")String member);


    @PostMapping(value = "/cache/hincrby/{key}/{filed}/{delta}")
    public Long hIncrBy(@PathVariable(value = "key")String key,
                        @PathVariable(value = "filed")String filed,
                        @PathVariable(value = "delta")Long delta);

    @GetMapping("/cache/hgetall/{key}")
    Map hGetAll(@PathVariable(value = "key")String key);

    @GetMapping("/cache/smember/{key}")
    Set<Map> smemberMap(@PathVariable(value = "key")String key);
}

